package com.osfw.system.entity.dict;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.osfw.framework.constants.Constants;
import com.osfw.framework.constants.UserConstants;
import com.osfw.framework.core.entity.BaseEntity;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 字典数据表 sys_dict_data
 */
@Data
@Accessors(chain = true)
public class SysDictData extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /* 字典编码 */
    @TableId(value = "dict_code_", type = IdType.ASSIGN_ID)
    private Long dictCode;

    /* 字典排序 */
    @TableField(value = "dict_sort_")
    private Long dictSort;

    /* 字典标签 */
    @NotBlank(message = "字典标签不能为空")
    @Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
    @TableField(value = "dict_label_")
    private String dictLabel;

    /* 字典键值 */
    @NotBlank(message = "字典键值不能为空")
    @Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
    @TableField(value = "dict_value_")
    private String dictValue;

    /* 字典类型 */
    @NotBlank(message = "字典类型不能为空")
    @Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
    @TableField(value = "dict_type_")
    private String dictType;

    /* 样式属性（其他样式扩展） */
    @Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
    @TableField(value = "css_class_")
    private String cssClass;

    /* 表格字典样式 */
    @TableField(value = "list_class_")
    private String listClass;

    /* 是否默认（Y是 N否） */
    @TableField(value = "is_default_")
    private String isDefault;

    /* 是否系统内置（Y是 N否） */
    @TableField(value = "build_in_")
    private String buildIn;

    /* 状态（0正常 1停用） */
    @TableField(value = "status_")
    private String status;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("dictCode", getDictCode())
                .append("dictSort", getDictSort())
                .append("dictLabel", getDictLabel())
                .append("dictValue", getDictValue())
                .append("dictType", getDictType())
                .append("cssClass", getCssClass())
                .append("listClass", getListClass())
                .append("isDefault", getIsDefault())
                .append("status", getStatus())
                .append("buildIn", getBuildIn())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}
